package com.tiantianyuegou.adapter;

import android.content.Context;
import android.widget.ImageView;

import com.nostra13.universalimageloader.core.ImageLoader;
import com.trouble.framework.adapter.BaseAdapterHelper;
import com.trouble.framework.adapter.QuickAdapter;
import com.tiantianyuegou.R;

import java.util.List;

/**
 * Created by ivany on 2016/2/4.
 */
public class GridImgAdapter extends QuickAdapter<GridImgAdapter.ReasonImg> {

    public GridImgAdapter(Context context,List<ReasonImg> datas) {
        super(context, R.layout.item_gird_img);
        data.clear();
        data.addAll(datas);
    }

    @Override
    protected void convert(BaseAdapterHelper baseAdapterHelper, ReasonImg reasonImg) {
        ImageView imageView = baseAdapterHelper.getView(R.id.item_gird_img);
        ImageLoader.getInstance().displayImage(reasonImg.imgUrl, imageView);
    }

    public static class ReasonImg {
        String imgUrl;

        public String getImgUrl() {
            return imgUrl;
        }

        public void setImgUrl(String imgUrl) {
            this.imgUrl = imgUrl;
        }
    }
}
